package com.example.index

import android.content.Intent
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.os.Handler
import androidx.core.app.ActivityCompat
import io.reactivex.Flowable
import io.reactivex.disposables.Disposable
import java.util.concurrent.TimeUnit

class SplashActivity : AppCompatActivity() {


    val task = Runnable {
        startActivity(Intent(this, IndexActivity::class.java))
        ActivityCompat.finishAfterTransition(this)
    }

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_splash)

        Handler().postDelayed(task, 2000)
    }

    override fun onDestroy() {
        super.onDestroy()
        Handler().removeCallbacks(task)
    }
}
